﻿//////////////////////////////////////////////////////////////////////////////////////
///// Touch.cs                                                            /////
///// 사용자로부터 입력을 받음                                /////
//////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace Pyramid_Game
{
    public class Touch
    {
        #region Declarations
        //Gesture를 담을 List
        public List<GestureSample> Gestures = new List<GestureSample>();

        #endregion

        #region Initialize

        public void Initialize()
        {
            TouchPanel.EnabledGestures =
                GestureType.Hold |
                GestureType.Tap |
                GestureType.DoubleTap |
                GestureType.FreeDrag |
                GestureType.Flick |
                GestureType.Pinch |
                GestureType.DragComplete;
        }

        #endregion

        #region Update

        public void Update(GameTime gameTime)
        {
            Gestures.Clear();

            while (TouchPanel.IsGestureAvailable)
            {
                Gestures.Add(TouchPanel.ReadGesture());
            }
        }

        #endregion
    }
}
